package com.manpower.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * MpDept entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "mp_dept", catalog = "manpower")
public class MpDept implements java.io.Serializable {

	// Fields

	private String id;
	private MpDept mpDept;
	private String deptNameComplete;
	private String deptNameSimple;
	private String deptAddress;
	private String deptRemarks;
	private String deptActivation;
	private Set<MpPosition> mpPositions = new HashSet<MpPosition>(0);
	private Set<MpRenshi> mpRenshis = new HashSet<MpRenshi>(0);
	private Set<MpRecruitment> mpRecruitments = new HashSet<MpRecruitment>(0);
	private Set<MpQuestion> mpQuestions = new HashSet<MpQuestion>(0);
	private Set<MpJobtitle> mpJobtitles = new HashSet<MpJobtitle>(0);
	private Set<MpDept> mpDepts = new HashSet<MpDept>(0);

	// Constructors

	/** default constructor */
	public MpDept() {
	}

	/** minimal constructor */
	public MpDept(String id) {
		this.id = id;
	}

	/** full constructor */
	public MpDept(String id, MpDept mpDept, String deptNameComplete,
			String deptNameSimple, String deptAddress, String deptRemarks,
			String deptActivation, Set<MpPosition> mpPositions,
			Set<MpRenshi> mpRenshis, Set<MpRecruitment> mpRecruitments,
			Set<MpQuestion> mpQuestions, Set<MpJobtitle> mpJobtitles,
			Set<MpDept> mpDepts) {
		this.id = id;
		this.mpDept = mpDept;
		this.deptNameComplete = deptNameComplete;
		this.deptNameSimple = deptNameSimple;
		this.deptAddress = deptAddress;
		this.deptRemarks = deptRemarks;
		this.deptActivation = deptActivation;
		this.mpPositions = mpPositions;
		this.mpRenshis = mpRenshis;
		this.mpRecruitments = mpRecruitments;
		this.mpQuestions = mpQuestions;
		this.mpJobtitles = mpJobtitles;
		this.mpDepts = mpDepts;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "dept_parent")
	public MpDept getMpDept() {
		return this.mpDept;
	}

	public void setMpDept(MpDept mpDept) {
		this.mpDept = mpDept;
	}

	@Column(name = "dept_name_complete", length = 200)
	public String getDeptNameComplete() {
		return this.deptNameComplete;
	}

	public void setDeptNameComplete(String deptNameComplete) {
		this.deptNameComplete = deptNameComplete;
	}

	@Column(name = "dept_name_simple", length = 200)
	public String getDeptNameSimple() {
		return this.deptNameSimple;
	}

	public void setDeptNameSimple(String deptNameSimple) {
		this.deptNameSimple = deptNameSimple;
	}

	@Column(name = "dept_address", length = 200)
	public String getDeptAddress() {
		return this.deptAddress;
	}

	public void setDeptAddress(String deptAddress) {
		this.deptAddress = deptAddress;
	}

	@Column(name = "dept_remarks", length = 200)
	public String getDeptRemarks() {
		return this.deptRemarks;
	}

	public void setDeptRemarks(String deptRemarks) {
		this.deptRemarks = deptRemarks;
	}

	@Column(name = "dept_activation", length = 2)
	public String getDeptActivation() {
		return this.deptActivation;
	}

	public void setDeptActivation(String deptActivation) {
		this.deptActivation = deptActivation;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpDept")
	public Set<MpPosition> getMpPositions() {
		return this.mpPositions;
	}

	public void setMpPositions(Set<MpPosition> mpPositions) {
		this.mpPositions = mpPositions;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpDept")
	public Set<MpRenshi> getMpRenshis() {
		return this.mpRenshis;
	}

	public void setMpRenshis(Set<MpRenshi> mpRenshis) {
		this.mpRenshis = mpRenshis;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpDept")
	public Set<MpRecruitment> getMpRecruitments() {
		return this.mpRecruitments;
	}

	public void setMpRecruitments(Set<MpRecruitment> mpRecruitments) {
		this.mpRecruitments = mpRecruitments;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpDept")
	public Set<MpQuestion> getMpQuestions() {
		return this.mpQuestions;
	}

	public void setMpQuestions(Set<MpQuestion> mpQuestions) {
		this.mpQuestions = mpQuestions;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpDept")
	public Set<MpJobtitle> getMpJobtitles() {
		return this.mpJobtitles;
	}

	public void setMpJobtitles(Set<MpJobtitle> mpJobtitles) {
		this.mpJobtitles = mpJobtitles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpDept")
	public Set<MpDept> getMpDepts() {
		return this.mpDepts;
	}

	public void setMpDepts(Set<MpDept> mpDepts) {
		this.mpDepts = mpDepts;
	}

}